/*
 * ACEDrawingView: https://github.com/acerbetti/ACEDrawingView
 *
 * Copyright (c) 2013 Stefano Acerbetti
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 */

#import <UIKit/UIKit.h>
#import "DropDownChooseProtocol.h"
#import "DropDownListView.h"
#define ACEDrawingViewVersion   1.0.0
typedef struct
{
    float x;
    float y;
}Point2D;
typedef enum {
    ACEDrawingToolTypePen,
    ACEDrawingToolTypeLine,
    ACEDrawingToolTypeRectagleStroke,
    ACEDrawingToolTypeRectagleFill,
    ACEDrawingToolTypeEllipseStroke,
    ACEDrawingToolTypeEllipseFill,
} ACEDrawingToolType;
typedef NS_ENUM(NSInteger, DrawingModeing) {
    DrawingModeNoneing = 0,
    DrawingModePainting,
    DrawingModeEraseing,
};
@protocol ACEDrawingViewDelegate, ACEDrawingTool;

@interface ACEDrawingView : UIView

@property (nonatomic, readwrite) DrawingModeing drawingMode;
@property (nonatomic, assign) ACEDrawingToolType drawTool;
@property (nonatomic, assign) id<ACEDrawingViewDelegate> delegate;

// public properties
@property (nonatomic, strong) UIColor *lineColor;
@property (nonatomic, assign) CGFloat lineWidth;
@property (nonatomic, assign) CGFloat lineAlpha;
//@property (nonatomic, assign) CGFloat nowX;
//@property (nonatomic, assign) CGFloat nowY;

// get the current drawing
@property (nonatomic, strong) UIImage *image;
@property (nonatomic, readonly) NSUInteger undoSteps;
Copy NSString *jsonGetevents;
Strong NSMutableDictionary *dicData;
Strong NSMutableArray *btnDataArr; // 画按钮的倍数关系
Strong NSMutableArray *buttonArr; //所有按钮事件的集合
Strong DropDownListView *dropListView;
Strong NSString *hostId;
Strong NSMutableArray *hostIdarr;
Strong NSMutableArray *pointArr;

//Assign id<PIDrawerDelegte> delegate;
Assign NSInteger flagForScreen; //是否透屏幕的标志
Assign CGFloat zoomX; //屏幕的分辨率的倍数
Assign CGFloat zoomY;
Assign NSInteger screenWidth;
Assign NSInteger screenHeight;
Assign BOOL forScreenFlag;
Assign BOOL forScreenall;

Assign BOOL doubleClickflag;
Assign BOOL colseEvent;

Assign BOOL isAddPoint;
// erase all
- (void)clear;

// undo / redo
- (BOOL)canUndo;
- (void)undoLatestStep;

- (BOOL)canRedo;
- (void)redoLatestStep;
-(void)forButtonHidden:(BOOL)hidd;
//-(void)counstInit;
-(void)drawButtonTalk;
- (void)configure;

@end


#pragma mark -

@protocol ACEDrawingViewDelegate <NSObject>

@optional
- (void)drawingView:(ACEDrawingView *)view willBeginDrawUsingTool:(id<ACEDrawingTool>)tool;
- (void)drawingView:(ACEDrawingView *)view didEndDrawUsingTool:(id<ACEDrawingTool>)tool;
-(void) talkBtnClick:(UIButton *)btn;
@end
